import axios from 'axios'
// 引入store
import store from '@/store'
const request = axios.create({
  baseURL: 'http://liufusong.top:8080'
})
// 请求拦截器
request.interceptors.request.use((config) => {
  // console.log('Bearer ' + store.state.user.token)
  if (store.state.user) {
    config.headers.Authorization = store.state.user.token
  }
  return config
})
export default request
